package com.example.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import java.util.ArrayList;

import com.example.smart_home.R;
import com.example.util.CommandCommunicate;
import com.example.util.ShowHandle;

public class MediaPlayerActivity extends Activity
  implements View.OnTouchListener
{
  Button btn10;
  Button btn11;
  Button btn12;
  Button btn13;
  Button btn14;
  Button btn15;
  Button btn16;
  Button btn17;
  Button btn18;
  ImageButton btn19;
  ImageButton btn20;
  ImageButton btn21;
  ImageButton btn22;
  ImageButton btn23;
  ImageButton btn24;
  ImageButton btn25;
  Button btn26;
  Button btn27;
  Button btn28;
  Button btn29;
  Button btn3;
  Button btn30;
  Button btn31;
  Button btn4;
  Button btn5;
  Button btn6;
  Button btn7;
  Button btn8;
  Button btn9;
  MediaPlayerActivity context;
  ArrayList<String[]> data;
  String deviceId;
  private CommandCommunicate mCommandCommunicate;
  ShowHandle showHandle;

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(R.layout.media_dvd);
    this.context = this;
    this.showHandle = new ShowHandle(this, "it");
    this.deviceId = getIntent().getStringExtra("deviceId");
    this.showHandle.OpenDb();
    this.data = this.showHandle.getDeviceKey(this.deviceId);
    this.showHandle.CloseDb();
    this.mCommandCommunicate = new CommandCommunicate(this);
    ((TextView)findViewById(R.id.title)).setText(getResources().getString(R.string.dvd));
    ((TextView)findViewById(R.id.tvHomeName)).setText(getIntent().getStringExtra("roomName"));
    findViewById(R.id.btnBack).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
       // MyAudioManager.spPlaySound(0, false);
        MediaPlayerActivity.this.finish();
      }
    });
    findViewById(R.id.btnOpen).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(0))[3]);
      }
    });
    findViewById(R.id.btnClose).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(1))[3]);
      }
    });
    this.btn3 = ((Button)findViewById(R.id.btn3));
    this.btn3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(2))[3]);
      }
    });
    this.btn3.setOnTouchListener(this);
    ((ImageButton)findViewById(R.id.btn4)).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(3))[3]);
      }
    });
    ((ImageButton)findViewById(R.id.btn4)).setOnTouchListener(this);
    findViewById(R.id.btn5).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(4))[3]);
      }
    });
    findViewById(R.id.btn5).setOnTouchListener(this);
    this.btn6 = ((Button)findViewById(R.id.btn6));
    this.btn6.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(5))[3]);
      }
    });
    this.btn6.setOnTouchListener(this);
    this.btn7 = ((Button)findViewById(R.id.btn7));
    this.btn7.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(6))[3]);
      }
    });
    this.btn7.setOnTouchListener(this);
    this.btn8 = ((Button)findViewById(R.id.btn8));
    this.btn8.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(7))[3]);
      }
    });
    this.btn8.setOnTouchListener(this);
    this.btn9 = ((Button)findViewById(R.id.btn9));
    this.btn9.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(8))[3]);
      }
    });
    this.btn9.setOnTouchListener(this);
    this.btn10 = ((Button)findViewById(R.id.btn10));
    this.btn10.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(9))[3]);
      }
    });
    this.btn10.setOnTouchListener(this);
    this.btn11 = ((Button)findViewById(R.id.btn11));
    this.btn11.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(10))[3]);
      }
    });
    this.btn11.setOnTouchListener(this);
    this.btn12 = ((Button)findViewById(R.id.btn12));
    this.btn12.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(11))[3]);
      }
    });
    this.btn12.setOnTouchListener(this);
    this.btn13 = ((Button)findViewById(R.id.btn13));
    this.btn13.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(12))[3]);
      }
    });
    this.btn13.setOnTouchListener(this);
    this.btn14 = ((Button)findViewById(R.id.btn14));
    this.btn14.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(13))[3]);
      }
    });
    this.btn14.setOnTouchListener(this);
    this.btn15 = ((Button)findViewById(R.id.btn15));
    this.btn15.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(14))[3]);
      }
    });
    this.btn15.setOnTouchListener(this);
    this.btn16 = ((Button)findViewById(R.id.btn16));
    this.btn16.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(15))[3]);
      }
    });
    this.btn16.setOnTouchListener(this);
    this.btn17 = ((Button)findViewById(R.id.btn17));
    this.btn17.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(16))[3]);
      }
    });
    this.btn17.setOnTouchListener(this);
    this.btn18 = ((Button)findViewById(R.id.btn18));
    this.btn18.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(17))[3]);
      }
    });
    this.btn18.setOnTouchListener(this);
    this.btn19 = ((ImageButton)findViewById(R.id.btn19));
    this.btn19.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(18))[3]);
      }
    });
    this.btn19.setOnTouchListener(this);
    this.btn20 = ((ImageButton)findViewById(R.id.btn20));
    this.btn20.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(19))[3]);
      }
    });
    this.btn20.setOnTouchListener(this);
    findViewById(R.id.btn21).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(20))[3]);
      }
    });
    findViewById(R.id.btn21).setOnTouchListener(this);
    findViewById(R.id.btn22).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(21))[3]);
      }
    });
    findViewById(R.id.btn22).setOnTouchListener(this);
    this.btn23 = ((ImageButton)findViewById(R.id.btn23));
    this.btn23.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(22))[3]);
      }
    });
    this.btn23.setOnTouchListener(this);
    this.btn24 = ((ImageButton)findViewById(R.id.btn24));
    this.btn24.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(23))[3]);
      }
    });
    this.btn24.setOnTouchListener(this);
    findViewById(R.id.btn25).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(24))[3]);
      }
    });
    findViewById(R.id.btn26).setOnTouchListener(this);
    findViewById(R.id.btn27).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(25))[3]);
      }
    });
    findViewById(R.id.btn26).setOnTouchListener(this);
    findViewById(R.id.btn27).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(26))[3]);
      }
    });
    findViewById(R.id.btn27).setOnTouchListener(this);
    findViewById(R.id.btn28).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(27))[3]);
      }
    });
    findViewById(R.id.btn28).setOnTouchListener(this);
    findViewById(R.id.btn29).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(28))[3]);
      }
    });
    findViewById(R.id.btn29).setOnTouchListener(this);
    this.btn30 = ((Button)findViewById(R.id.btn30));
    this.btn30.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MediaPlayerActivity.this.mCommandCommunicate.send(((String[])MediaPlayerActivity.this.data.get(29))[3]);
      }
    });
    this.btn30.setOnTouchListener(this);
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    return false;
  }
}
